package com.acheng.ws.client.listener;

import io.netty.channel.Channel;
import io.netty.handler.codec.http.FullHttpResponse;

/**
 * websocket的消息监听
 */
public interface WebSocketListener {
    void onOpen(Channel webSocket, FullHttpResponse response);

    void onMessage(Channel webSocket, String text);

    void onMessage(Channel webSocket, byte[] bytes);

    void onClosing(Channel webSocket, int code, String reason);

    void onClosed(Channel webSocket, int code, String reason);

    void onFailure(Channel webSocket, Throwable t, FullHttpResponse response);

    void onFailure(Channel webSocket, Throwable t);

}
